home *** CD-ROM | disk | FTP | other *** search
- <PUBLIC:COMPONENT lightWeight=true>
-
- <PUBLIC:EVENT name="onflydone" ID=done />
-
- <PUBLIC:PROPERTY NAME="speed" />
- <PUBLIC:PROPERTY NAME="source" />
- <PUBLIC:PROPERTY NAME="endPoint" />
-
- <PUBLIC:METHOD NAME="flyout" />
-
- <SCRIPT LANGUAGE="JScript">
- var iEnd, iSpeed, iCount = 0;
- function doflyout()
- {
- var iAdjust, ssty = source.style;
- if (ssty.posLeft != iEnd)
- {
- iAdjust = iSpeed;
-
- if (IsRTLPage())
- {
- if ((iEnd - ssty.posLeft) < iSpeed)
- {
- iAdjust = (iEnd - ssty.posLeft) / 4;
- if (iAdjust < 4) iAdjust = iEnd - ssty.posLeft;
- }
- ssty.posLeft += iAdjust;
- }
- else
- {
- if ((ssty.posLeft - iEnd) < iSpeed)
- {
- iAdjust = (ssty.posLeft - iEnd) / 4;
- if (iAdjust < 4) iAdjust = ssty.posLeft - iEnd;
- }
- ssty.posLeft -= iAdjust;
- }
- window.setTimeout(doflyout, 1);
- }
- else
- {
- var e = createEventObject();
- e.direction = 1;
- e.page = source;
- done.fire(e);
- }
- }
-
- function flyaway()
- {
- var ssty = source.style, fDone = false;
-
- if (IsRTLPage())
- {
- if (ssty.posLeft > iEnd)
- ssty.posLeft -= iSpeed;
- else
- fDone = true;
- }
- else
- {
- if (ssty.posLeft < iEnd)
- ssty.posLeft += iSpeed;
- else
- fDone = true;
- }
-
- if (!fDone)
- window.setTimeout(flyaway, 1);
- else
- {
- var e = createEventObject();
- e.direction = 0;
- e.page = source;
- done.fire(e);
- }
- }
-
- function flyout(iDir)
- {
- iEnd = parseInt(endPoint);
- iSpeed = parseInt(speed);
- if (iDir == 1)
- doflyout();
- else
- flyaway();
- }
-
- </SCRIPT>
- </PUBLIC:COMPONENT>
-